<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    
    <head>
        <meta charset="utf-8">
        <meta name="Keywords" content="" />
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate,max-age=0,post-check=0, pre-check=0,false">
        <meta http-equiv="Pragma" CONTENT="no-cache">
        <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
        <title>搜索结果</title>

        <meta name="format-detection" content="telephone=no" />
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">

        <link href="/smfs/Public/mobile/css/nj_base.css" type="text/css" rel="stylesheet" />
        <script type="text/javascript" src="/smfs/Public/mobile/js/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="/smfs/Public/mobile/js/shopCommonSearch.js"></script>

        <link href="/smfs/Public/css/layui.css" rel="stylesheet" type="text/css" media="all"/>
        <script type="text/javascript" src="/smfs/Public/layui.js"></script>
    </head>
<body>
    <!-- header-section start-->
    <div class="header-section header-fixed">
        <div class="header-content">
            <a href="javascript:history.back();" id="J-headerBack" class="header-back">
            </a>
            <div id="J-searchBar" class="header-search">
                <i class="search-icon">
                </i>
                <input type="text" name="keyword" autocomplete="off" id="keywordShow"
                class="search-input" value="<?php echo res_catname($id),' ',zj_catname($id); ?>" placeholder="搜索商品" maxlength="20">
            </div>
            <a href="javascript:void(0);" class="search-btn hide">
                搜索
            </a>
            <a href="javascript:void(0);" class="header-menu" id="J-menu">
            </a>
        </div>
    </div>
    <div class="search-layer-section hide" id="popSearchLayer">
        <div class="search-layer-box">
            <div class="header-section">
                <div class="header-content" id="J-searchLayer">
                    <a href="javascript:;" class="search-cancel" id="J-searchCancel">取消</a>
                    <div class="header-search search-focus">
                        <i class="search-icon"></i>
                    <form action="<?php echo U('mobile/cha/index');?>" method="post">
                        <input type="text" name="keyword" autocomplete="off" class="search-input" value="" placeholder="输入商品名/货号" >
                        <i id="J-searchClear" class="search-clear hide"></i>
                    </div>
                    <button class="search-btn">搜索</button>
                    </form>
                </div>
            </div>
            <div class="search-layer-result scrollable">
                <div class="search-result-cat">
                    <?php foreach ($cats as $v) { ?>
                        <div class="search-result-list">
                            <a href="<?php echo U('mobile/cha/index',array('catid'=>$v['cat_id']));?>">
                            <div class="search-result-hd">
                                <p class="cell result-item-title" style="margin-left:<?php echo ($v["lev"]); ?>em"><?php echo ($v["cat_name"]); ?></p>
                                <div class="result-item-arrow"></div>
                            </div>
                            </a>
                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
    <div id="commonList" class="search-wrapper">
        <div id="J-sortTab" class="sort-tab border-grids" style="margin-top: 30px;">
            <div class="ui-flex sort-content">
            <?php if ($g == 'new') { ?>
                <a href="<?php echo U('mobile/cha/index');?>" class="cell" style="color:#222;">全部</a>
                <a href="<?php echo U('mobile/cha/index',array('id'=>$id,'g'=>'new'));?>" class="cell">新品</a>
                <a href="<?php echo U('mobile/cha/index',array('id'=>$id,'g'=>'hot'));?>" class="cell" style="color:#222;">热销</a>
            <?php }elseif ($g == 'hot') { ?>
                <a href="<?php echo U('mobile/cha/index');?>" class="cell" style="color:#222;">全部</a>
                <a href="<?php echo U('mobile/cha/index',array('id'=>$id,'g'=>'new'));?>" class="cell" style="color:#222;">新品</a>
                <a href="<?php echo U('mobile/cha/index',array('id'=>$id,'g'=>'hot'));?>" class="cell" style="color:#f23030">热销</a>
            <?php }else { ?>
                <a href="<?php echo U('mobile/cha/index');?>" class="cell">全部</a>
                <a href="<?php echo U('mobile/cha/index',array('id'=>$id,'g'=>'new'));?>" class="cell" style="color:#222;">新品</a>
                <a href="<?php echo U('mobile/cha/index',array('id'=>$id,'g'=>'hot'));?>" class="cell" style="color:#222;">热销</a>
            <?php } ?>
                <!-- <span name="search-sort-tab" searchsort="3" id="J-priceSort" class="cell sort-item">
                    价格
                    <i class="sort-icon"></i>
                </span> -->
            </div>
        </div>
        <div class="sort-list">
            <ul>
            <?php foreach ($goods as $v) { ?>
                <li>
                    <a href="<?php echo U('mobile/good/index',array('id'=>$v['goods_id']));?>">
                        <span class="img-box">
                            <img lay-src="/smfs<?php echo ($v["thumb_img"]); ?>" alt="<?php echo ($v["goods_name"]); ?>">
                        </span>
                        <span class="pro-desc">
                            <?php echo res_catname($v['cat_id']) ?> <?php echo ($v["goods_name"]); ?> <?php echo (mb_substr(strip_tags(htmlspecialchars_decode($v["goods_desc"])),0,20,'utf-8')); ?>...
                        </span>
                        <span class="pro-price">
                            <span class="price-info">
                                <em class="price-yen">¥</em>
                                <em class="price-int"><?php echo ($v["shop_price"]); ?></em>
                            </span>
                        </span>
                    </a>
                </li>
            <?php } ?>
            </ul>
        </div>
    </div>
<script>
layui.use('flow', function(){
  var $ = layui.jquery;
  var flow = layui.flow;
 
  //按屏加载图片
  flow.lazyimg({
    elem: '.sort-list img'
  });
  
});
</script>
</body>    
</html>